package com.agua.enturno.vista.componentes;

import com.agua.enturno.vista.modelos.WeekDayLabelModel;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;
import org.joda.time.LocalDate;

public class WeekDayLabel extends Label {

	private static final long serialVersionUID = 1L;
	private IModel<LocalDate> model;

	public WeekDayLabel(String id, IModel<LocalDate> model) {
		super(id, new WeekDayLabelModel(model));
		this.model = model;
	}
	
	@Override
	protected void onComponentTag(ComponentTag tag) {
		super.onComponentTag(tag);
		
		if (LocalDate.now().isEqual(model.getObject()))
			tag.append("class", "dia-de-la-semana-hoy", " ");
	}

}
